﻿using Allin.Abp.AspNetCore.Components.Web.AntDesignTheme.Themes.AntDesign;
using Allin.Abp.AspNetCore.Components.Web.Theming.Theming;
using System;
using Volo.Abp.DependencyInjection;
using Allin.Abp.AspNetCore.Components.Web.Theming.Layout;

namespace Allin.Abp.AspNetCore.Components.Web.AntDesignTheme
{
    [ThemeName(Name)]
    public class AntDesignTheme : ITheme, ITransientDependency
    {
        public const string Name = "AntDesign";

        public Type GetLayout(string name, bool fallbackToDefault = true)
        {
            switch (name)
            {
                case StandardLayouts.Application:
                case StandardLayouts.Account:
                case StandardLayouts.Empty:
                    return typeof(MainLayout);
                default:
                    return fallbackToDefault ? typeof(MainLayout) : typeof(NullLayout);
            }
        }
    }
}
